package com.fht.util;


import com.fht.enums.ManagermentSystemEnum;
import com.fht.exception.ManagermentSystemException;
import com.fht.vo.ResultVO;

public class ResultVOUtil {

    public static ResultVO ok(){
        return new ResultVO(0,"成功",null);
    }

    public static ResultVO  ok(Object data){
        return new ResultVO(0,"",data);
    }

    public static ResultVO error(Integer code,String msg){
        return new ResultVO(code,msg,null);
    }

    public static ResultVO  error(ManagermentSystemEnum jxcEnum){
        return new ResultVO(jxcEnum.getCode(),jxcEnum.getMsg(),null);
    }

    public static ResultVO error(ManagermentSystemException ex){
        return new ResultVO(ex.getCode(),ex.getMessage(),null);
    }
}
